/*     */ package com.openbravo.pos.forms;
/*     */ 
/*     */ import com.openbravo.basic.BasicException;
/*     */ import com.openbravo.beans.JFlowPanel;
/*     */ import com.openbravo.beans.JPasswordDialog;
/*     */ import com.openbravo.data.gui.JMessageDialog;
/*     */ import com.openbravo.data.gui.MessageInf;
/*     */ import com.openbravo.data.loader.BatchSentence;
/*     */ import com.openbravo.data.loader.BatchSentenceResource;
/*     */ import com.openbravo.data.loader.Session;
/*     */ import com.openbravo.data.loader.SessionDB;
/*     */ import com.openbravo.pos.printer.DeviceDisplay;
/*     */ import com.openbravo.pos.printer.DeviceTicket;
/*     */ import com.openbravo.pos.printer.TicketParser;
/*     */ import com.openbravo.pos.printer.TicketPrinterException;
/*     */ import com.openbravo.pos.scale.DeviceScale;
/*     */ import com.openbravo.pos.scanpal2.DeviceScanner;
/*     */ import com.openbravo.pos.scanpal2.DeviceScannerFactory;

/*     */ import java.awt.BorderLayout;
/*     */ import java.awt.CardLayout;
/*     */ import java.awt.ComponentOrientation;
/*     */ import java.awt.Cursor;
/*     */ import java.awt.Dimension;
/*     */ import java.awt.EventQueue;
/*     */ import java.awt.GridLayout;
/*     */ import java.awt.Window;
/*     */ import java.awt.event.ActionEvent;
/*     */ import java.awt.event.ActionListener;
/*     */ import java.awt.event.KeyAdapter;
/*     */ import java.awt.event.KeyEvent;
/*     */ import java.awt.image.BufferedImage;
/*     */ import java.lang.reflect.Constructor;
/*     */ import java.sql.SQLException;
/*     */ import java.util.Date;
/*     */ import java.util.HashMap;
/*     */ import java.util.List;
/*     */ import java.util.Locale;
/*     */ import java.util.Map;
/*     */ import java.util.Properties;
/*     */ import java.util.UUID;
/*     */ import java.util.regex.Matcher;

/*     */ import javax.swing.AbstractAction;
/*     */ import javax.swing.BorderFactory;
/*     */ import javax.swing.BoxLayout;
/*     */ import javax.swing.ImageIcon;
/*     */ import javax.swing.JButton;
/*     */ import javax.swing.JLabel;
/*     */ import javax.swing.JOptionPane;
/*     */ import javax.swing.JPanel;
/*     */ import javax.swing.JScrollBar;
/*     */ import javax.swing.JScrollPane;
/*     */ import javax.swing.JTextField;
/*     */ import javax.swing.JViewport;
/*     */ import javax.swing.SwingUtilities;
/*     */ import javax.swing.UIDefaults;
/*     */ import javax.swing.UIManager;
/*     */  @SuppressWarnings("all")
/*     */ public class JRootApp extends JPanel
/*     */   implements AppView
/*     */ {
/*     */   private AppProperties m_props;
/*     */   private Session session;
/*     */   private DataLogicSystem m_dlSystem;
/*  60 */   private Properties m_propsdb = null;
/*     */   private String m_sActiveCashIndex;
/*     */   private int m_iActiveCashSequence;
/*     */   private Date m_dActiveCashDateStart;
/*     */   private Date m_dActiveCashDateEnd;
/*     */   private String m_sInventoryLocation;
/*     */   private StringBuffer inputtext;
/*     */   private DeviceScale m_Scale;
/*     */   private DeviceScanner m_Scanner;
/*     */   private DeviceTicket m_TP;
/*     */   private TicketParser m_TTP;
/*     */   private Map<String, BeanFactory> m_aBeanFactories;
/*  77 */   private JPrincipalApp m_principalapp = null;
/*     */   private static HashMap<String, String> m_oldclasses;
/*     */   private JLabel jLabel1;
/*     */   private JLabel jLabel2;
/*     */   private JPanel jPanel1;
/*     */   private JPanel jPanel2;
/*     */   private JPanel jPanel3;
/*     */   private JPanel jPanel4;
/*     */   private JPanel jPanel5;
/*     */   private JPanel jPanel8;
/*     */   private JScrollPane jScrollPane1;
/*     */   private JButton m_jClose;
/*     */   private JLabel m_jHost;
/*     */   private JLabel m_jLblTitle;
/*     */   private JPanel m_jLogonName;
/*     */   private JPanel m_jPanelContainer;
/*     */   private JPanel m_jPanelDown;
/*     */   private JPanel m_jPanelLogin;
/*     */   private JPanel m_jPanelTitle;
/*     */   private JTextField m_txtKeys;
/*     */   private JPanel panelTask;
/*     */   private JLabel poweredby;
/*     */ 
/*     */   public JRootApp()
/*     */   {
/*  88 */     this.m_aBeanFactories = new HashMap();
/*     */ 
/*  91 */     initComponents();
/*  92 */     this.jScrollPane1.getVerticalScrollBar().setPreferredSize(new Dimension(35, 35));
/*     */   }
/*     */ 
/*     */   public boolean initApp(AppProperties props)
/*     */   {
/*  97 */     this.m_props = props;
/*     */ 
/* 101 */     applyComponentOrientation(ComponentOrientation.getOrientation(Locale.getDefault()));
/*     */     try
/*     */     {
/* 105 */       this.session = AppViewConnection.createSession(this.m_props);
/*     */     } catch (BasicException e) {
/* 107 */       JMessageDialog.showMessage(this, new MessageInf(-16777216, e.getMessage(), e));
/* 108 */       return false;
/*     */     }
/*     */ 
/* 111 */     this.m_dlSystem = ((DataLogicSystem)getBean("com.openbravo.pos.forms.DataLogicSystem"));
/*     */ 
/* 114 */     String sDBVersion = readDataBaseVersion();
sDBVersion="2.30.2";//ati for use mysql ...ori is 2.30.2,but use mysql is null...so recover to 2.30.2
//for update script ,,
/* 115 */     if (!"2.30.2".equals(sDBVersion))
/*     */     {
/* 119 */       String sScript = this.m_dlSystem.getInitScript() + "-upgrade-" + sDBVersion + ".sql";
/*     */ 
/* 123 */       if (JRootApp.class.getResource(sScript) == null) {
/* 124 */         JMessageDialog.showMessage(this, new MessageInf(-16777216, sDBVersion == null ? AppLocal.getIntString("message.databasenotsupported", new Object[] { this.session.DB.getName() }) : AppLocal.getIntString("message.noupdatescript")));
/*     */ 
/* 127 */         this.session.close();
/* 128 */         return false;
/*     */       }
/*     */ 
/* 131 */       if (JOptionPane.showConfirmDialog(this, AppLocal.getIntString(sDBVersion == null ? "message.createdatabase" : "message.updatedatabase"), AppLocal.getIntString("message.title"), 0, 3) == 0)
/*     */       {
/*     */         try
/*     */         {
/* 137 */           BatchSentence bsentence = new BatchSentenceResource(this.session, sScript);
/* 138 */           bsentence.putParameter("APP_ID", Matcher.quoteReplacement("powerfulpos"));
/* 139 */           bsentence.putParameter("APP_NAME", Matcher.quoteReplacement("PFPOS"));
/* 140 */           bsentence.putParameter("APP_VERSION", Matcher.quoteReplacement("2.30.2"));
/*     */ 
/* 142 */           List l = bsentence.list();
/* 143 */           if (l.size() > 0)
/* 144 */             JMessageDialog.showMessage(this, new MessageInf(-33554432, AppLocal.getIntString("Database.ScriptWarning"), l.toArray(new Throwable[l.size()])));
/*     */         }
/*     */         catch (BasicException e) {
/* 147 */           JMessageDialog.showMessage(this, new MessageInf(-16777216, AppLocal.getIntString("Database.ScriptError"), e));
/* 148 */           this.session.close();
/* 149 */           return false;
/*     */         }
/*     */       } else {
/* 152 */         this.session.close();
/* 153 */         return false;
/*     */       }
/*     */ 
/*     */     }
/*     */ 
/* 159 */     String sName = this.m_props.getHost() + "/properties";
this.m_propsdb = this.m_dlSystem.getResourceAsProperties(sName);
/*     */     try
/*     */     {
/* 163 */       String sActiveCashIndex = this.m_propsdb.getProperty("activecash");
/* 164 */       Object[] valcash = sActiveCashIndex == null ? null : this.m_dlSystem.findActiveCash(sActiveCashIndex);
/*     */ 
/* 167 */       if ((valcash == null) || (!this.m_props.getHost().equals(valcash[0])))
/*     */       {
/* 169 */         setActiveCash(UUID.randomUUID().toString(), this.m_dlSystem.getSequenceCash(this.m_props.getHost()) + 1, new Date(), null);
/*     */ 
/* 172 */         this.m_dlSystem.execInsertCash(new Object[] { getActiveCashIndex(), this.m_props.getHost(), Integer.valueOf(getActiveCashSequence()), getActiveCashDateStart(), getActiveCashDateEnd() });
/*     */       }
/*     */       else {
/* 175 */         setActiveCash(sActiveCashIndex, ((Integer)valcash[1]).intValue(), (Date)valcash[2], (Date)valcash[3]);
/*     */       }
/*     */     }
/*     */     catch (BasicException e) {
					//ati p15 for mysql 
///* 179 */       MessageInf msg = new MessageInf(-67108864, AppLocal.getIntString("message.cannotclosecash"), e);
///* 180 */       msg.show(this);
//				//ati pb12
///* 181 */      this.session.close();
///* 182 */      return false;
/*     */     }
/*     */ 
/* 186 */     this.m_sInventoryLocation = this.m_propsdb.getProperty("location");
/* 187 */     if (this.m_sInventoryLocation == null) {
/* 188 */       this.m_sInventoryLocation = "0";
/* 189 */       this.m_propsdb.setProperty("location", this.m_sInventoryLocation);
/* 190 */       this.m_dlSystem.setResourceAsProperties(sName, this.m_propsdb); } 
/*     */ this.m_TP = new DeviceTicket(this, this.m_props);
/*     */ 
/* 197 */     this.m_TTP = new TicketParser(getDeviceTicket(), this.m_dlSystem);
/* 198 */     printerStart();
/*     */ 
/* 201 */     this.m_Scale = new DeviceScale(this, this.m_props);
/*     */ 
/* 204 */     this.m_Scanner = DeviceScannerFactory.createInstance(this.m_props);
/*     */ 
/* 207 */     BufferedImage imgicon = this.m_dlSystem.getResourceAsImage("Window.Logo");
/* 208 */     this.m_jLblTitle.setIcon(imgicon == null ? null : new ImageIcon(imgicon));

//this.m_dlSystem.getResourceAsText("Window.Title")
/* 209 */     this.m_jLblTitle.setText("m_jLblTitle.Window.Title");
/*     */     String sWareHouse;
/*     */     try { sWareHouse = this.m_dlSystem.findLocationName(this.m_sInventoryLocation);
/*     */     } catch (BasicException e) {
/* 215 */       sWareHouse = null;
/*     */     }
/*     */     String url;
/*     */     try
/*     */     {
/* 221 */       url = this.session.getURL();
/*     */     } catch (SQLException e) {
/* 223 */       url = "";
/*     */     }
/* 225 */     this.m_jHost.setText("<html>m_jHost" + this.m_props.getHost() + " - " + sWareHouse + "<br>" + url);
/*     */ 
/* 227 */     showLogin();


		//	this.setVisible(false);
/*     */ 
/* 229 */     return true;


/*     */   }
/*     */ 
/*     */   private String readDataBaseVersion() {
/*     */     try {
/* 234 */       return this.m_dlSystem.findVersion(); } catch (BasicException ed) {
/*     */     }
/* 236 */     return null;
/*     */   }
/*     */ 
/*     */   public void tryToClose()
/*     */   {
/* 242 */     if (closeAppView())
/*     */     {
/* 247 */       this.m_TP.getDeviceDisplay().clearVisor();
/*     */ 
/* 249 */       this.session.close();
/*     */ 
/* 252 */       SwingUtilities.getWindowAncestor(this).dispose();
/*     */     }
/*     */   }
/*     */ 
/*     */   public DeviceTicket getDeviceTicket()
/*     */   {
/* 258 */     return this.m_TP;
/*     */   }
/*     */ 
/*     */   public DeviceScale getDeviceScale() {
/* 262 */     return this.m_Scale;
/*     */   }
/*     */   public DeviceScanner getDeviceScanner() {
/* 265 */     return this.m_Scanner;
/*     */   }
/*     */ 
/*     */   public Session getSession() {
/* 269 */     return this.session;
/*     */   }
/*     */ 
/*     */   public String getInventoryLocation() {
/* 273 */     return this.m_sInventoryLocation;
/*     */   }
/*     */   public String getActiveCashIndex() {
/* 276 */     return this.m_sActiveCashIndex;
/*     */   }
/*     */   public int getActiveCashSequence() {
/* 279 */     return this.m_iActiveCashSequence;
/*     */   }
/*     */   public Date getActiveCashDateStart() {
/* 282 */     return this.m_dActiveCashDateStart;
/*     */   }
/*     */   public Date getActiveCashDateEnd() {
/* 285 */     return this.m_dActiveCashDateEnd;
/*     */   }
/*     */   public void setActiveCash(String sIndex, int iSeq, Date dStart, Date dEnd) {
/* 288 */     this.m_sActiveCashIndex = sIndex;
/* 289 */     this.m_iActiveCashSequence = iSeq;
/* 290 */     this.m_dActiveCashDateStart = dStart;
/* 291 */     this.m_dActiveCashDateEnd = dEnd;
/*     */ 
/* 293 */     this.m_propsdb.setProperty("activecash", this.m_sActiveCashIndex);

//ati 
/* 294 */   //  this.m_dlSystem.setResourceAsProperties(this.m_props.getHost() + "/properties", this.m_propsdb);
/*     */   }
/*     */ 
/*     */   public AppProperties getProperties() {
/* 298 */     return this.m_props;
/*     */   }
/*     */ 
/*     */   public Object getBean(String beanfactory)
/*     */     throws BeanFactoryException
/*     */   {
/* 304 */     beanfactory = mapNewClass(beanfactory);
/*     */ 
/* 307 */     BeanFactory bf = (BeanFactory)this.m_aBeanFactories.get(beanfactory);
/* 308 */     if (bf == null)
/*     */     {
/* 311 */       if (beanfactory.startsWith("/"))
/* 312 */         bf = new BeanFactoryScript(beanfactory);
/*     */       else {
/*     */         try
/*     */         {
/* 316 */           Class bfclass = Class.forName(beanfactory);
/*     */ 
/* 318 */           if (BeanFactory.class.isAssignableFrom(bfclass)) {
/* 319 */             bf = (BeanFactory)bfclass.newInstance();
/*     */           }
/*     */           else {
/* 322 */             Constructor constMyView = bfclass.getConstructor(new Class[] { AppView.class });
/* 323 */             Object bean = constMyView.newInstance(new Object[] { this });
/*     */ 
/* 325 */             bf = new BeanFactoryObj(bean);
/*     */           }
/*     */         }
/*     */         catch (Exception e)
/*     */         {
/* 330 */           throw new BeanFactoryException(e);
/*     */         }
/*     */ 
/*     */       }
/*     */ 
/* 335 */       this.m_aBeanFactories.put(beanfactory, bf);
/*     */ 
/* 338 */       if ((bf instanceof BeanFactoryApp)) {
/* 339 */         ((BeanFactoryApp)bf).init(this);
/*     */       }
/*     */     }
/* 342 */     return bf.getBean();
/*     */   }
/*     */ 
/*     */   private static String mapNewClass(String classname) {
/* 346 */     String newclass = (String)m_oldclasses.get(classname);
/* 347 */     return newclass == null ? classname : newclass;
/*     */   }
/*     */ 
/*     */   private static void initOldClasses()
/*     */   {
/* 353 */     m_oldclasses = new HashMap();
/*     */ 
/* 356 */     m_oldclasses.put("com.openbravo.pos.reports.JReportCustomers", "/com/openbravo/reports/customers.bs");
/* 357 */     m_oldclasses.put("com.openbravo.pos.reports.JReportCustomersB", "/com/openbravo/reports/customersb.bs");
/* 358 */     m_oldclasses.put("com.openbravo.pos.reports.JReportClosedPos", "/com/openbravo/reports/closedpos.bs");
/* 359 */     m_oldclasses.put("com.openbravo.pos.reports.JReportClosedProducts", "/com/openbravo/reports/closedproducts.bs");
/* 360 */     m_oldclasses.put("com.openbravo.pos.reports.JChartSales", "/com/openbravo/reports/chartsales.bs");
/* 361 */     m_oldclasses.put("com.openbravo.pos.reports.JReportInventory", "/com/openbravo/reports/inventory.bs");
/* 362 */     m_oldclasses.put("com.openbravo.pos.reports.JReportInventory2", "/com/openbravo/reports/inventoryb.bs");
/* 363 */     m_oldclasses.put("com.openbravo.pos.reports.JReportInventoryBroken", "/com/openbravo/reports/inventorybroken.bs");
/* 364 */     m_oldclasses.put("com.openbravo.pos.reports.JReportInventoryDiff", "/com/openbravo/reports/inventorydiff.bs");
/* 365 */     m_oldclasses.put("com.openbravo.pos.reports.JReportPeople", "/com/openbravo/reports/people.bs");
/* 366 */     m_oldclasses.put("com.openbravo.pos.reports.JReportTaxes", "/com/openbravo/reports/taxes.bs");
/* 367 */     m_oldclasses.put("com.openbravo.pos.reports.JReportUserSales", "/com/openbravo/reports/usersales.bs");
/* 368 */     m_oldclasses.put("com.openbravo.pos.reports.JReportProducts", "/com/openbravo/reports/products.bs");
/* 369 */     m_oldclasses.put("com.openbravo.pos.reports.JReportCatalog", "/com/openbravo/reports/productscatalog.bs");
/*     */ 
/* 372 */     m_oldclasses.put("com.openbravo.pos.panels.JPanelTax", "com.openbravo.pos.inventory.TaxPanel");
/*     */   }
/*     */ 
/*     */   public void waitCursorBegin()
/*     */   {
/* 377 */     setCursor(Cursor.getPredefinedCursor(3));
/*     */   }
/*     */ 
/*     */   public void waitCursorEnd() {
/* 381 */     setCursor(Cursor.getPredefinedCursor(0));
/*     */   }
/*     */ 
/*     */   public AppUserView getAppUserView() {
/* 385 */     return this.m_principalapp;
/*     */   }
/*     */ 
/*     */   private void printerStart()
/*     */   {
/* 391 */     String sresource = this.m_dlSystem.getResourceAsXML("Printer.Start");
/* 392 */     if (sresource == null)
/* 393 */       this.m_TP.getDeviceDisplay().writeVisor("PFPOS", "2.30.2");
/*     */     else
/*     */       try {
/* 396 */         this.m_TTP.printTicket(sresource);
/*     */       } catch (TicketPrinterException eTP) {
/* 398 */         this.m_TP.getDeviceDisplay().writeVisor("PFPOS", "2.30.2");
/*     */       }
/*     */   }
/*     */ 
/*     */   private void listPeople()
/*     */   {
/*     */     try
/*     */     {
/* 407 */       this.jScrollPane1.getViewport().setView(null);
/*     */ 
/* 409 */       JFlowPanel jPeople = new JFlowPanel();
/* 410 */       jPeople.applyComponentOrientation(getComponentOrientation());
/*     */ 
/* 412 */       @SuppressWarnings("rawtypes")
List people = this.m_dlSystem.listPeopleVisible();
/*     */ 
/* 414 */       for (int i = 0; i < people.size(); i++)
/*     */       {
/* 416 */         AppUser user = (AppUser)people.get(i);
/*     */ 
/* 418 */         JButton btn = new JButton(new AppUserAction(user));
/* 419 */         btn.applyComponentOrientation(getComponentOrientation());
/* 420 */         btn.setFocusPainted(false);
/* 421 */         btn.setFocusable(false);
/* 422 */         btn.setRequestFocusEnabled(false);
/* 423 */         btn.setHorizontalAlignment(10);
/* 424 */         btn.setMaximumSize(new Dimension(150, 50));
/* 425 */         btn.setPreferredSize(new Dimension(150, 50));
/* 426 */         btn.setMinimumSize(new Dimension(150, 50));
/*     */ 
/* 428 */         jPeople.add(btn);
/*     */       }
/* 430 */       this.jScrollPane1.getViewport().setView(jPeople);
/*     */     }
/*     */     catch (BasicException ee) {
/* 433 */       ee.printStackTrace();
/*     */     }
/*     */   }
/*     */ 
/*     */   private void showView(String view)
/*     */   {
/* 475 */     CardLayout cl = (CardLayout)(CardLayout)this.m_jPanelContainer.getLayout();
/* 476 */     cl.show(this.m_jPanelContainer, view);
/*     */   }
/*     */ 

//com.openbravo.pos.forms.AppUser@aa262d
/*     */   private void openAppView(AppUser user)
/*     */   {
/* 481 */     if (closeAppView())
/*     */     {
	//com.openbravo.pos.forms.JPrincipalApp[,0,0,0x0,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
/* 483 */       this.m_principalapp = new JPrincipalApp(this, user);
/*     */ 
/* 486 */       this.jPanel3.add(this.m_principalapp.getNotificator());
/* 487 */       this.jPanel3.revalidate();
/*     */ 
/* 490 */       String id = this.m_principalapp.getUser().getId();

//JPanel m_jPanelContainer
this.m_jPanelContainer.add(this.m_principalapp, "_" + id);
/* 491 */       showView("_" + id);
/*     */ 

//com.openbravo.pos.forms.JPrincipalApp        ext jpanel
//show menu
/* 493 */       this.m_principalapp.activate();
/*     */     }
/*     */   }
/*     */ 
/*     */   public boolean closeAppView()
/*     */   {
/* 499 */     if (this.m_principalapp == null)
/* 500 */       return true;
/* 501 */     if (!this.m_principalapp.deactivate()) {
/* 502 */       return false;
/*     */     }
/*     */ 
/* 505 */     this.jPanel3.remove(this.m_principalapp.getNotificator());
/* 506 */     this.jPanel3.revalidate();
/* 507 */     this.jPanel3.repaint();
/*     */ 
/* 510 */     this.m_jPanelContainer.remove(this.m_principalapp);
/* 511 */     this.m_principalapp = null;
/*     */ 
/* 513 */     showLogin();
/*     */ 
/* 515 */     return true;
/*     */   }
/*     */ 
/*     */   private void showLogin()
/*     */   {
/* 522 */     listPeople();
/* 523 */     showView("login");
/*     */ 
/* 526 */     printerStart();
/*     */ 
/* 529 */     this.inputtext = new StringBuffer();
/* 530 */     this.m_txtKeys.setText(null);
/* 531 */     EventQueue.invokeLater(new Runnable() {
/*     */       public void run() {
/* 533 */         JRootApp.this.m_txtKeys.requestFocus();
/*     */       }
/*     */     });
/*     */   }
/*     */ 
/*     */   private void processKey(char c) {
/* 540 */     if (c == '\n')
/*     */     {
/* 542 */       AppUser user = null;
/*     */       try {
/* 544 */         user = this.m_dlSystem.findPeopleByCard(this.inputtext.toString());
/*     */       } catch (BasicException e) {
/* 546 */         e.printStackTrace();
/*     */       }
/*     */ 
/* 549 */       if (user == null)
/*     */       {
/* 551 */         MessageInf msg = new MessageInf(-33554432, AppLocal.getIntString("message.nocard"));
/* 552 */         msg.show(this);
/*     */       } else {
/* 554 */         openAppView(user);
/*     */       }
/*     */ 
/* 557 */       this.inputtext = new StringBuffer();
/*     */     } else {
/* 559 */       this.inputtext.append(c);
/*     */     }
/*     */   }
/*     */ 
/*     */   private void initComponents()
/*     */   {
/* 572 */     this.m_jPanelTitle = new JPanel();
/* 573 */     this.m_jLblTitle = new JLabel();
/* 574 */     this.poweredby = new JLabel();
/* 575 */     this.jLabel2 = new JLabel();
/* 576 */     this.m_jPanelContainer = new JPanel();
/* 577 */     this.m_jPanelLogin = new JPanel();
/* 578 */     this.jPanel4 = new JPanel();
/* 579 */     this.jLabel1 = new JLabel();
/* 580 */     this.jPanel5 = new JPanel();
/* 581 */     this.m_jLogonName = new JPanel();
/* 582 */     this.jScrollPane1 = new JScrollPane();
/* 583 */     this.jPanel2 = new JPanel();
/* 584 */     this.jPanel8 = new JPanel();
/* 585 */     this.m_jClose = new JButton();
/* 586 */     this.jPanel1 = new JPanel();
/* 587 */     this.m_txtKeys = new JTextField();
/* 588 */     this.m_jPanelDown = new JPanel();
/* 589 */     this.panelTask = new JPanel();
/* 590 */     this.m_jHost = new JLabel();
/* 591 */     this.jPanel3 = new JPanel();
/*     */ 
/* 593 */     setPreferredSize(new Dimension(1024, 768));
/* 594 */     setLayout(new BorderLayout());
/*     */ 
/* 596 */     this.m_jPanelTitle.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getDefaults().getColor("Button.darkShadow")));
/* 597 */     this.m_jPanelTitle.setLayout(new BorderLayout());
/*     */ 
/* 599 */     this.m_jLblTitle.setHorizontalAlignment(0);
/* 600 */     this.m_jLblTitle.setText("m_jLblTitle.Window.Title");
/* 601 */     this.m_jPanelTitle.add(this.m_jLblTitle, "Center");
/*     */ 
/* 603 */  //   this.poweredby.setIcon(new ImageIcon(getClass().getResource("/com/openbravo/images/poweredby.png")));
/* 604 */     this.poweredby.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
/* 605 */     this.m_jPanelTitle.add(this.poweredby, "After");
/*     */ 
/* 607 */     this.jLabel2.setPreferredSize(new Dimension(142, 34));
/* 608 */     this.m_jPanelTitle.add(this.jLabel2, "Before");
/*     */ 
/* 610 */     add(this.m_jPanelTitle, "North");
/*     */ 
/* 612 */     this.m_jPanelContainer.setLayout(new CardLayout());
/*     */ 
/* 614 */     this.m_jPanelLogin.setLayout(new BorderLayout());
/*     */ 
/* 616 */     this.jPanel4.setLayout(new BoxLayout(this.jPanel4, 1));
/*     */ 
/* 618 */     this.jLabel1.setHorizontalAlignment(0);
/* 619 */  //   this.jLabel1.setIcon(new ImageIcon(getClass().getResource("/com/openbravo/images/logo.png")));
/* 620 */     this.jLabel1.setText("q111");
		//"<html><center>PowerFul POS 收银系统采用开源技术开发，支持开源数据库，高度可定制.<br>支持条码扫描 触摸屏 移动点菜.<br>适用于零售业，餐饮等大中小用户<br>PowerFul POS 是完全免费的软件: 你可以在GNU协议下修改重构.<br><br>我们为用户提供有偿技术服务：安装指导  系统实施  实时灾备 商业智能分析  动态数据挖掘<br><br>您可以从www.pfpos.com下载标准版本的收银系统，获得基本的操作手册或观看相关视频.<br></center>");
/*     */ 
/* 629 */     this.jLabel1.setAlignmentX(0.5F);
/* 630 */     this.jLabel1.setHorizontalTextPosition(0);
/* 631 */     this.jLabel1.setMaximumSize(new Dimension(800, 1024));
/* 632 */     this.jLabel1.setVerticalTextPosition(3);
/* 633 */     this.jPanel4.add(this.jLabel1);
/*     */ 
/* 635 */     this.m_jPanelLogin.add(this.jPanel4, "Center");
/*     */ 
/* 637 */     this.m_jLogonName.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
/* 638 */     this.m_jLogonName.setLayout(new BorderLayout());
/*     */ 
/* 640 */     this.jScrollPane1.setHorizontalScrollBarPolicy(31);
/* 641 */     this.jScrollPane1.setVerticalScrollBarPolicy(22);
/* 642 */     this.jScrollPane1.setPreferredSize(new Dimension(510, 118));
/* 643 */     this.m_jLogonName.add(this.jScrollPane1, "Center");
/*     */ 
/* 645 */     this.jPanel2.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
/* 646 */     this.jPanel2.setLayout(new BorderLayout());
/*     */ 
/* 648 */     this.jPanel8.setLayout(new GridLayout(0, 1, 5, 5));
/*     */ 
/* 650 */     this.m_jClose.setIcon(new ImageIcon(getClass().getResource("/com/openbravo/images/exit.png")));
/* 651 */     this.m_jClose.setText(AppLocal.getIntString("Button.Close"));
/* 652 */     this.m_jClose.setFocusPainted(false);
/* 653 */     this.m_jClose.setFocusable(false);
/* 654 */     this.m_jClose.setPreferredSize(new Dimension(115, 35));
/* 655 */     this.m_jClose.setRequestFocusEnabled(false);
/* 656 */     this.m_jClose.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent evt) {
/* 658 */         JRootApp.this.m_jCloseActionPerformed(evt);
/*     */       }
/*     */     });
/* 661 */     this.jPanel8.add(this.m_jClose);
/*     */ 
/* 663 */     this.jPanel2.add(this.jPanel8, "North");
/*     */ 
/* 665 */     this.jPanel1.setLayout(null);
/*     */ 
/* 667 */     this.m_txtKeys.setPreferredSize(new Dimension(0, 0));
/* 668 */     this.m_txtKeys.addKeyListener(new KeyAdapter() {
/*     */       public void keyTyped(KeyEvent evt) {
/* 670 */         JRootApp.this.m_txtKeysKeyTyped(evt);
/*     */       }
/*     */     });
/* 673 */     this.jPanel1.add(this.m_txtKeys);
/* 674 */     this.m_txtKeys.setBounds(0, 0, 0, 0);
/*     */ 
/* 676 */     this.jPanel2.add(this.jPanel1, "Center");
/*     */ 
/* 678 */     this.m_jLogonName.add(this.jPanel2, "After");
/*     */ 
/* 680 */     this.jPanel5.add(this.m_jLogonName);
/*     */ 
/* 682 */     this.m_jPanelLogin.add(this.jPanel5, "South");
/*     */ 
/* 684 */     this.m_jPanelContainer.add(this.m_jPanelLogin, "login");
/*     */ 
/* 686 */     add(this.m_jPanelContainer, "Center");
/*     */ 
/* 688 */     this.m_jPanelDown.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIManager.getDefaults().getColor("Button.darkShadow")));
/* 689 */     this.m_jPanelDown.setLayout(new BorderLayout());
/*     */ 
/* 691 */     this.m_jHost.setIcon(new ImageIcon(getClass().getResource("/com/openbravo/images/display.png")));
/* 692 */     this.m_jHost.setText("m_jHost"+"*Hostname");
/* 693 */     this.panelTask.add(this.m_jHost);
/*     */ 
/* 695 */     this.m_jPanelDown.add(this.panelTask, "Before");
/* 696 */     this.m_jPanelDown.add(this.jPanel3, "After");
/*     */ 
/* 698 */     add(this.m_jPanelDown, "South");
/*     */   }
/*     */ 
/*     */   private void m_jCloseActionPerformed(ActionEvent evt)
/*     */   {
/* 704 */     tryToClose();
/*     */   }
/*     */ 
/*     */   private void m_txtKeysKeyTyped(KeyEvent evt)
/*     */   {
/* 710 */     this.m_txtKeys.setText("0");
/*     */ 
/* 712 */     processKey(evt.getKeyChar());
/*     */   }
/*     */ 
/*     */   static
/*     */   {
/*  82 */     initOldClasses();
/*     */   }
/*     */ 
/*     */   private class AppUserAction extends AbstractAction
/*     */   {
/*     */     private AppUser m_actionuser;
/*     */ 
/*     */     public AppUserAction(AppUser user)
/*     */     {
/* 442 */       this.m_actionuser = user;
/* 443 */       putValue("SmallIcon", this.m_actionuser.getIcon());
/* 444 */       putValue("Name", this.m_actionuser.getName());
/*     */     }
/*     */ 
/*     */    
public AppUser getUser() {
/* 448 */       return this.m_actionuser;
/*     */     }
/*     */ 
/*     */     public void actionPerformed(ActionEvent evt)
/*     */     {
/* 453 */       if (this.m_actionuser.authenticate())
/*     */       {
/* 455 */         JRootApp.this.openAppView(this.m_actionuser);
/*     */       }
/*     */       else {
/* 458 */         String sPassword = JPasswordDialog.showEditPassword(JRootApp.this, AppLocal.getIntString("Label.Password"), this.m_actionuser.getName(), this.m_actionuser.getIcon());
/*     */ 
/* 462 */         if (sPassword != null)
/* 463 */           if (this.m_actionuser.authenticate(sPassword)) {
/* 464 */             JRootApp.this.openAppView(this.m_actionuser);
/*     */           } else {
/* 466 */             MessageInf msg = new MessageInf(-33554432, AppLocal.getIntString("message.BadPassword"));
/* 467 */             msg.show(JRootApp.this);
/*     */           }
/*     */       }
/*     */     }
/*     */   }
/*     */ }

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.forms.JRootApp
 * JD-Core Version:    0.6.0
 */